<!DOCTYPE html>
<html lang="en">
    <head>
        <title></title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <script src="./lib/vue-2.4.0.js"></script>
    </head>
    <body>
        <div id="app">
            <p>{{msg | bian('上海自来水来自海上') }}</p>
        </div>

        <hr>
        <div id="app2">
            <p>{{bb | ku('都是猪')}}</p>
        </div>

        <script>
            Vue.filter('bian',function(msg,arg){
                return msg.replace(/一块五花肉花五块一/g,arg)

            })
            var vm = new Vue({
                el: '#app',
                data: {
                    msg:'莺莺燕燕融融恰恰唧唧喳喳好不烦恼,一块五花肉花五块一'
                },
                methods:{

                }
            })

            var vm = new Vue({
                el: '#app2',
                data: {
                    msg:'莺莺燕燕融融恰恰唧唧喳喳好不烦恼,一块五花肉花五块一',
                    bb:'猪有几只,曰,李慧贤,彭城,田余帅,徐娟,邓金慧,郑峰,邓家瑞'
                },
                methods:{

                },
                filters:{//私有过滤器
                    ku(bb,age){
                        return bb.replace(/李慧贤/g,age);

                    }

                }
            })
        </script>
    </body>
</html>